// Vue.config.js
const path = require('path')
const resolve = dir => path.join(__dirname, dir)
module.exports = {
  // 配置项
  // 设置别名
  chainWebpack: config => {
    config.resolve.alias
      .set('@js', resolve('src/assets/js'))
      .set('@css', resolve('src/assets/css'))
      .set('@less', resolve('src/assets/less'))
      .set('@img', resolve('src/assets/img'))
      .set('@com', resolve('src/components'))
      .set('@page', resolve('src/view'))

    config.plugins.delete('prefetch')
  },
  // 基本路径
  publicPath: './',
  // 设置启动项
  devServer: {
    host: 'localhost',
    port: 8000,
    proxy: {
      '/api': {
        target: 'http://localhost:3000',
        changeOrigin: true,
        pathRewrite: {
          "/api": ""
        }
      }
    },

  },
  lintOnSave: false,

}